<template>
  <div>
    <div id="way" @click="open">
      <span class="iconfont"></span>
      <span>规则</span>
    </div>
    <div class="activity" v-show="isshow">
      <div class="rule" v-show="isshow">
        <header>
          <img src="../../static/images/top.png" alt="">
        </header>
        <div class="rule-main">
          <div id="active">
            <div class="active_header">
              <span>活动说明:</span>
            </div>
            <div class="active_main"><p>参与活动即有机会获得幸运奖~每天抽奖机会8次免费。此活动为概率中奖，奖品数量有限，祝好运！
              <br>惊喜一：0元购iPhoneX<br>惊喜二：500元现金红包
              <br>惊喜三：小米mix2<br>惊喜四：88元现金红包 <br>惊喜五：幸运福袋&nbsp;</p><p>－－－－－－－－－－－－－－－－
              <br>重要声明：
              <br>1.奖品将在活动结束后5-10个工作日安排发放,请耐心等待
              <br>2.优惠券类奖品的使用规则详见每个优惠券的介绍页
              <br>3.请兑换后仔细阅读使用流程,如有疑问,可直接联系客服专线:400-630-5186或客服QQ:3511735466(工作日9:00至18:00) <br>4.通过非法途径获得奖品的,主办方有权不提供奖品</p></div>
          </div>
          <div id="more">
            <div class="more_header" @click="moreclick">
              更多概率说明
            </div>
            <div class="more_main" v-show="moreshow"><p>中奖概率说明：
              <br>•0元购iPhoneX共5份，中奖概率0.008%;
              <br>•500元现金红包共50份,中奖概率0.01%;
              <br>•小米mix2共500份,中奖概率0.05%;
              <br>•88元现金红包共1000份,中奖概率0.1%;</p></div>
          </div>
          <div class="close" @click="close">
            <span class="iconfont"></span>
          </div>
        </div>
      </div>
    </div>
  </div>


</template>

<script>
    export default {
        name:'Way',
        data () {
            return {
              isshow:false,
              moreshow:false
            }
        },
        methods:{
          open: function () {
              this.isshow=true
          },
          moreclick:function(){
            this.moreshow=!this.moreshow
          },
          close:function(){
            this.isshow=false
          }
        }
    }
</script>

<style>
  #way {
    width: 2.8rem;
    height: 1rem;
    position: absolute;
    top: 0.6rem;
    left: 0.2rem;
    background-color: rgba(181, 181, 181, 0.7);
    color: #FFFFFF;
    display: flex;
    display: -webkit-box;
    display: -moz-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    -webkit-box-align: center;
    -moz-align-items: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -moz-justify-content: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-box-direction: normal;
    -webkit-box-orient: horizontal;
    -moz-flex-direction: row;
    -webkit-flex-direction: row;
    flex-direction: row;
    border-radius: 0.5rem;
  }

  #way span {
    font-size: 0.7rem;
    display: inline-block;
    color: #FFFFFF;
  }

  #way span:nth-of-type(2) {
    display: inline-block;
    font-size: 0.6rem;
    line-height: 1rem;
    margin-left: 0.1rem;
  }
  /*活动规则样式*/
  .activity {
    width: auto;
    height: auto;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.5);
    background-position: center;
    background-repeat: no-repeat;
    z-index: 99999;
  }

  .rule {
    width: 15.5rem;
    /*height: 20rem;*/
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    z-index: 111;
    background-color: #FFFFFF;
    border-radius: 8px;
    overflow-x: hidden;
    font-size: 0.65rem;
    color: #804e00;
    animation: rule 0.5s linear forwards;
    -webkit-animation: rule 0.5s linear forwards;
  }

  .rule-main {
    overflow: scroll;
    height: 15rem;
  }

  .rule header {
    text-align: center;
    font-size: 0.8rem;
    color: #804e00;
    font-weight: bold;
  }

  .rule header img {
    width: 100%;
  }

  #active,
  #important {
    margin: 0 0.5rem;
  }

  #active {
    padding-right: 1rem;
    position: relative;
  }

  /*#active:after {*/
    /*content: '';*/
    /*width: 4px;*/
    /*height: 95px;*/
    /*position: absolute;*/
    /*top: 0;*/
    /*right: 0;*/
    /*background-color: #CB800A;*/
    /*border-radius: 4px;*/
  /*}*/

  #more {
    margin: 0.3rem 0.5rem;
  }

  .more_header {
    text-align: center;
    color: #FFFFFF;
    height: 1rem;
    width: 100%;
    background-color: #cb800a;
    line-height: 0.9rem;
    border-radius: 3px;
    font-size: 0.6rem;
  }

  .collapse {
    font-size: 0.6rem;
    margin-left: 0.1rem;
  }

  .off {
    height: 0px;
    overflow: hidden;
    transition: height 1s;
    transition: height 1s;
    -moz-transition: height 1s;
    -webkit-transition: height 1s;
    -o-transition: height 1s;
  }

  .close {
    position: fixed;
    top: 0.3rem;
    right: 0.3rem;
  }

  .close span {
    color: #804e00;
    font-size: 1.25rem;
  }
</style>
